import requests

def location(key):
    #web 服务的 url及参数
    url = "https://restapi.amap.com/v3/ip?key="+key
    response = requests.get(url) #发送get请求
    # 如果请求成功
    if response.status_code == 200:
        return response.json()

if __name__ =="__main__":
    result = location("69b4610d4aa6d1db4cd736c82f393e2b")
    print(result)